﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace QuanTriHeThongKhoDiaChinh
{
    public partial class frmKetNoi : Form
    {
        public frmKetNoi()
        {
            InitializeComponent();
        }
        TaoKetNoi objTaoKetNoi = new TaoKetNoi();
        private void btnKetNoi_Click(object sender, EventArgs e)
        {
            try 
	        {
                objTaoKetNoi.KetNoi(txtServer.Text, txtDatabase.Text, txtUser.Text, txtPass.Text);
                MessageBox.Show("Kết nối thành công");
                this.Hide();
                frmPhanQuyen frm = new frmPhanQuyen();
                frm.Show();

	        }
	        catch (SqlException ex)
	        {
                MessageBox.Show("Kết nối thất bại "+ ex);
	        }
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}
